; Contains: Apple Speech Recognition Toolbox Interfaces.
;
; Version: Technology: PlainTalk 1.5
;
; Release: PlainTalk Developer Release
;
; Copyright: ⌐ 1984-1995 by Apple Computer, Inc.
;
; All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__SPEECHRECOGNITION__') = 'UNDEFINED' THEN
__SPEECHRECOGNITION__ SET 1
IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
include 'Memory.a'
ENDIF
gestaltSpeechRecognitionVersion EQU 'srtb'
gestaltSpeechRecognitionAttr EQU 'srta'
gestaltDesktopSpeechRecognition EQU $01
gestaltTelephoneSpeechRecognition EQU $02
; Error Codes [Speech recognition gets -5100 through -5199]
eSRNotAvailable EQU -5100 ; the service requested is not avail or applicable
eSRInternalError EQU -5101 ; a system internal or hardware error condition
eSRComponentNotFound EQU -5102 ; a needed system resource was not located
eSROutOfMemory EQU -5103 ; an out of memory error occurred in the toolbox memory space
eSRNotASpeechObject EQU -5104 ; the object specified is no longer or never was valid
eSRBadParameter EQU -5105 ; an invalid parameter was specified
eSRParamOutOfRange EQU -5106 ; when we say 0-100, don't pass in 101.
eSRBadSelector EQU -5107 ; an unrecognized selector was specified
eSRBufferTooSmall EQU -5108 ; returned from attribute access functions
eSRNotARecSystem EQU -5109 ; the object used was not a RecognitionSystem
eSRFeedbackNotAvail EQU -5110 ; there is no feedback window associated with Recognizer
eSRCantSetProperty EQU -5111 ; a non-settable property was specified
eSRCantGetProperty EQU -5112 ; a non-gettable property was specified
eSRCantSetDuringRecognition EQU -5113 ; the property can't be set while recognition is in progress -- do before or between utterances.
eSRAlreadyListening EQU -5114 ; in response to SRStartListening
eSRNotListeningState EQU -5115 ; in response to SRStopListening
eSRModelMismatch EQU -5116 ; no acoustical models are avail to match request
eSRNoClientLanguageModel EQU -5117 ; trying to access a non-specified LanguageModel
eSRNoPendingUtterances EQU -5118 ; nothing to continue search on
eSRRecognitionCanceled EQU -5119 ; an abort error occurred during search
eSRRecognitionDone EQU -5120 ; search has finished, but nothing was recognized
eSROtherRecAlreadyModal EQU -5121 ; another recognizer is modal at the moment, so can't set this recognizer's kBlockModally property right now
eSRHasNoSubItems EQU -5122 ; SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM.
eSRSubItemNotFound EQU -5123 ; returned when accessing a non-existent sub item of a container
eSRLanguageModelTooBig EQU -5124 ; Cant build language models so big
eSRAlreadyReleased EQU -5125 ; this object has already been released before
eSRAlreadyFinished EQU -5126 ; the language model can't be finished twice
eSRWordNotFound EQU -5127 ; the spelling couldn't be found in lookup(s)
eSRNotFinishedWithRejection EQU -5128 ; property not found because the LMObj is not finished with rejection
eSRExpansionTooDeep EQU -5129 ; Language model is left recursive or is embedded too many levels
eSRTooManyElements EQU -5130 ; Too many elements added to phrase or path or other langauge model object
eSRCantAdd EQU -5131 ; Can't add given type of object to the base LanguageObject (e.g.in SRAddLanguageObject)
eSRSndInSourceDisconnected EQU -5132 ; Sound input source is disconnected
eSRCantReadLanguageObject EQU -5133 ; An error while trying to create new Language object from file or pointer -- possibly bad format
; non-release debugging error codes are included here
eSRNotImplementedYet EQU -5199 ; you'd better wait for this feature in a future release
; Type Definitions
; typedef unsigned long SpeechObject
; typedef SpeechObject RecognitionSystem
; typedef SpeechObject Recognizer
; typedef SpeechObject SpeechSource
; typedef SpeechSource RecognitionResult
; typedef SpeechObject LanguageObject
; typedef LanguageObject LanguageModel
; typedef LanguageObject LMPath
; typedef LanguageObject LMPhrase
; typedef LanguageObject LMWord
; typedef unsigned long LMFlags
; between 0 and 100
; typedef unsigned short SpeedSetting
; between 0 and 100
; typedef unsigned short RejectionLevel
; When an event occurs, the user supplied proc will be called with a pointer
; to the param passed in and a flag to indicate conditions such
; as interrupt time or system background time.
SRCallBackStruct RECORD 0
what ds.l 1 ; offset: $0 (0) ; one of notification flags
kNotifyRecognitionBeginning EQU $01 ; recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition
kNotifyRecognitionDone EQU $02 ; recognition has terminated. result (if any) is available.
; Apple Event selectors
; AppleEvent message class
kAESpeechSuite EQU 'sprc'
; AppleEvent message event ids
kAESpeechDone EQU 'srsd'
kAESpeechDetected EQU 'srbd'
; AppleEvent Parameter ids
keyRecognizer EQU 'krec'
keySpeechResult EQU 'kspr'
keySpeechStatus EQU 'ksst'
; AppleEvent Parameter types
typeRecognizer EQU 'trec'
typeSpeechResult EQU 'tspr'
; Recognizer Properties
kSearchStatusParam EQU 'stat' ; see status flags below
kNotificationParam EQU 'noti' ; see notification flags below
kCallBackParam EQU 'call' ; type SRCallBackParam
kAutoFinishingParam EQU 'afin' ; automatic finishing applied on LM for search
kForegroundOnly EQU 'fgon' ; Boolean. Default is true. If true, client recognizer only active when in foreground.
kBlockBackground EQU 'blbg' ; Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.
kBlockModally EQU 'blmd' ; Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods!
kWantsResultTextDrawn EQU 'txfb' ; Boolean. Default is true. If true, search results are posted to Feedback window
kWantsAutoFBGestures EQU 'dfbr' ; Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior
kSoundInVolume EQU 'volu' ; short in [0..100] log scaled sound input power. Can't set this property
kReadAudioFSSpec EQU 'aurd' ; *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kCannedDesktopSpeechSource. Reads until EOF
kCancelOnSoundOut EQU 'caso' ; Boolean: Default is true. If any sound is played out during utterance, recognition is aborted.
kSpeedVsAccuracyParam EQU 'sped' ; SpeedSetting between 0 and 100
; 0 means more accurate but slower.
; 100 means (much) less accurate but faster.
kUseToggleListen EQU 0 ; listen key modes
kUsePushToTalk EQU 1
kListenKeyMode EQU 'lkmd' ; short: either kUseToggleListen or kUsePushToTalk
kListenKeyCombo EQU 'lkey' ; short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message
kKeyExpected EQU 'kexp' ; Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur?
; Operational Status Flags
kIdleRecognizer EQU $01 ; engine is not active
kSearchInProgress EQU $02 ; search is in progress
kSearchWaitForAllClients EQU $04 ; search is suspended waiting on all clients' input
kMustCancelSearch EQU $08 ; something has occurred (sound played, non-speech detected) requiring the search to abort
kPendingSearch EQU $10 ; we're about to start searching
; Recognition Result Properties
kTEXTFormat EQU 'TEXT' ; raw text in user supplied memory
kLMPhraseFormat EQU 'lmph' ; LMPhrase containing result words
kLMPathFormat EQU 'lmpt' ; LMPath containing result phrases or words
kLanguageModelFormat EQU 'lmfm' ; top level LanguageModel for post parse
; LanguageObject Family Properties
kSpelling EQU 'spel' ; spelling of a LMWord or LMPhrase or LMPath, or name of a LanguageModel
kLMObjType EQU 'lmtp' ; Returns one of LanguageObject Types listed below
kRefCon EQU 'refc' ; 4 bytes of user storage
kEnabled EQU 'enbl' ; Boolean -- true if LanguageObject enabled
kOptional EQU 'optl' ; Boolean -- true if LanguageObject is optional
kRepeatable EQU 'rptb' ; Boolean -- true if LanguageObject is repeatable
kRejectable EQU 'rjbl' ; Boolean -- true if LanguageObject is rejectable (Recognition System's kRejectedWord
; object can be returned in place of LanguageObject with this property)
kPrimitive EQU 'prim' ; Boolean -- determines what shows up in search result's list of primitives
kRejectionLevel EQU 'rjct' ; RejectionLevel between 0 and 100
kFinishingFlags EQU 'finf' ; Please use kOptional, kRepeatable, and kRejetable instead. pass pointer to LMFlags. Being phased out of public interfaces.
; LM Object Types -- returned as kLMObjType property of language model objects
kLMType EQU 'lmob' ; LanguageModel
kPathType EQU 'path' ; LMPath
kPhraseType EQU 'phra' ; LMPhrase
kWordType EQU 'word' ; LMWord
; a normal and reasonable rejection level
kDefaultLMRejectionLevel EQU 50
; Finishing Flags - used to make up LMFlags, which is used for kFinishingFlags and kAutoFinishingParam properties
; 4/10/95 These finishing flags are being phased out of the public interfaces. Please use kOptional, kRepeatable,
; and kRejectable Boolean LanguageObject properties instead. Those Boolean properties are easier to use.
; bit zero is reserved
kAddPauses EQU $02 ; allows user to pause between words
kAddRejection EQU $04 ; unrecognized words will be rejected
kAddNoise EQU $08 ; allows a some noise at beginning or end of utterance
kMakeOptional EQU $10 ; contents of LM are optional
kMakeRepeatable EQU $20 ; contents of LM may be repeated 0 or more times